package com.example.design.proxy.statical.specialty.proxy;

import com.example.design.proxy.statical.specialty.realsubject.LocalSpecialty;
import com.example.design.proxy.statical.specialty.subject.Specialty;

/**
 * @Description 特产代理类
 * @ClassName SpecialtyProxy
 * @Author Yumuhui
 * @Date 2020/5/14 0:28
 * @Version 1.0.0
 */
public class SpecialtyProxy implements Specialty {

    LocalSpecialty realSubject;

    public SpecialtyProxy(LocalSpecialty realSubject) {
        this.realSubject = realSubject;
    }

    @Override
    public void display() {
        preRequest();
        realSubject.display();
        postRequest();
    }
    public void preRequest()
    {
        System.out.println("代理土特产开始。");
    }
    public void postRequest()
    {
        System.out.println("代理土特产结束。");
    }
}
